home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
program
/
swagd_f.zip
/
DOS.SWG
/
0063_FASTEST File Exist (BASM).pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1994-08-24
|
664b
|
26 lines
Function FileExists(FileName : string) : boolean; assembler;
{ Determines whether the given file exists. Returns true if the file was found,
false - if there is no such file }
Asm
PUSH DS
LDS DX,FileName
INC DX
MOV AX,4300h { get information through the GetAttr function }
INT 21h
MOV AL,False { emulate AL=0 }
JC @@1
INC AL { emulate AL=AL+1=1 }
@@1:
POP DS
End; { FileExists }
const Found : array[Boolean] of string[10] = ('not found', 'found');
var FileName : string;
Begin
Write('Enter file name to search: ');
ReadLn(FileName);
WriteLn('File "', FileName, '" ', Found[FileExists(FileName)], '.');
End.